Skip to content

Added upgrade step to remove old compaction temp files#6435

Merged
dlmarion merged 4 commits into
apache:mainfrom
dlmarion:6285-del-comp-tmp-files-in-upgrade
Jul 10, 2026
Merged

Added upgrade step to remove old compaction temp files#6435
dlmarion merged 4 commits into
apache:mainfrom
dlmarion:6285-del-comp-tmp-files-in-upgrade

Conversation

@dlmarion

Copy link
Copy Markdown
Contributor

Closes #6285

@dlmarion dlmarion added this to the 4.0.0 milestone Jun 18, 2026
@dlmarion dlmarion self-assigned this Jun 18, 2026
@dlmarion dlmarion merged commit ac80237 into apache:main Jul 10, 2026
8 checks passed
@dlmarion dlmarion deleted the 6285-del-comp-tmp-files-in-upgrade branch July 10, 2026 22:21
FileStatus[] files = vol.getFileSystem().globStatus(volPattern,
(p) -> (p.getName().startsWith("" + FilePrefix.FULL_COMPACTION.getPrefix())
|| p.getName().startsWith("" + FilePrefix.COMPACTION.getPrefix()))
&& p.getName().endsWith(".rf_tmp"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This last check for the suffix is still unnecessary. That's what I was getting at with the suggestion to use the more specific glob pattern.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After simplifying that, the predicate can be simplified to be:

// before the globStatus() call
char first;
// inside the predicate
p -> (first = p.getName().charAt(0)) == FilePrefix.FULL_COMPACTION.getPrefix() || first == FilePrefix.COMPACTION.getPrefix();

(or can do it without the variable by repeating the charAt part)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup compaction tmp files in upgrade from 2.1 to 4.0

3 participants